

INCLUDES= -I../useful/ -I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux 
CPPFLAGS= -fPIC -g -Wall -DWEKA
#CPPFLAGS= -fPIC -g -Wall -DWEKA -DNOPRINTF
CC=g++
EXECUTABLE=o

OBJECTS_COMPLETE_PATH=	../phga/phga.o \
			../phga/../neighbor_joining/neighbor_joining.o \
			../phga/../neighbor_joining/Graph_Node.o \
			../phga/random.o \
			../phga/fitness.o \
			PhGA_Interface.o \
			../phga/../useful/useful_math.o 
		#	../phga/main.o \

OBJECTS	=		phga.o \
			neighbor_joining.o \
			Graph_Node.o \
			random.o \
			fitness.o \
			PhGA_Interface.o \
			useful_math.o 
		#	main.o \

%.o : %.cpp
	$(CC) $(CPPFLAGS) $(INCLUDES) -c $<

%.o : %.c
	$(CC) $(CPPFLAGS) $(INCLUDES) -c $<

shared: clean ${OBJECTS_COMPLETE_PATH}
	${CC} -shared -Wl,-soname,libPhGA_Interface.so.1 -o libPhGA_Interface.so ${OBJECTS} -lc
	@echo Compiling Java...; javac *.java
#	@echo Running...; 
#	@echo ; java main
#	@echo ;cd ../phga/; rm *.o 2>/dev/null 1>/dev/null -f

clean: 
	@echo Cleaning...; rm *.o -f; cd ../phga/; rm *.o 2>/dev/null 1>/dev/null -f

	
FILES= phga.cpp \
       ../neighbor_joining/neighbor_joining.cpp \
       ../neighbor_joining/Graph_Node.cpp \
       random.cpp \
       fitness.c \
       ../useful/useful_math.cpp


OBJECTS_JAVA=phga.o \
      ../neighbor_joining/neighbor_joining.o \
       ../neighbor_joining/Graph_Node.o \
       random.o \
       fitness.o \
       ../useful/useful_math.o \
       PhGA_Interface.o

#	${CC} ${CPPFLAGS} ${INCLUDES} -I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux ${OBJECTS}
#	g++ -shared -Wl,-soname,libPhGA_Interface.so.1 -o libPhGA_Interface.so ${OBJECTS} -lc
#	mv libPhGA_Interface.so ../java/
#	cd ../java/; ls ;export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}; javac *.java ; java main
